package Test;

import aop.AfterLogger;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AfterLoggerTest {
    @Test
    public void TestAfterLogger() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext4.xml");
        AfterLogger afterLogger1 = (AfterLogger) context.getBean("afterLogger1");
        try {
            throw new RuntimeException("测试异常");
        } catch (RuntimeException e) {
           afterLogger1.afterLogger(null);
        }
    }



}
